<template>
  <div class="errPage-container">
    <el-tree :props="props" :load="loadNode" lazy ></el-tree>
  </div>
</template>

<script>
export default {
  name: "Page401",
  data() {
    return {
      props: {
        label: "name",
        children: "zones",
        isLeaf: "leaf"
      }
    };
  },
  methods: {
    loadNode(node, resolve) {
      console.log( node )
      console.log( node.level )
      if (node.level === 0) {
        return resolve([{ name: "region" }]);
      }
      // if (node.level > 1) return resolve([]);
     //定时器可以换成ajax的请求
      setTimeout(() => {
        const data = [
          {
            name: "leaf",
            leaf: true
          },
          {
            name: "zone"
          }
        ];
        resolve(data);
      }, 500);
    }
  }
};
</script>

<style lang="scss" scoped>
.errPage-container {
  padding: 30px;
}
</style>
